package org.come.mouslisten;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import org.come.Frame.ZhuFrame;
import org.come.entity.Goodstable;
import org.come.until.DDGoodUntil;
import org.come.until.MessagrFlagUntil;

public class TakeBackGoodMouslisten implements MouseListener {

	private int index;//第几个表格

	public TakeBackGoodMouslisten(int index) {

		this.index = index;

	}

	@Override
	public void mouseClicked(MouseEvent e) {

		if (e.getButton() == MouseEvent.BUTTON3) {
			DDGoodUntil.Retrieve(index);
		}

	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseEntered(MouseEvent e) {
		if (MessagrFlagUntil.ImgFlagImg.equals(MessagrFlagUntil.MOUSE1)) {
			MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE12);
		}
		Goodstable good=DDGoodUntil.getgood(index);
		if (good!=null) {
			ZhuFrame.getZhuJpanel().creatgoodtext(good);
		}


	}

	@Override
	public void mouseExited(MouseEvent e) {
		if (MessagrFlagUntil.ImgFlagImg.equals(MessagrFlagUntil.MOUSE12)) {
			MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
		}
		// TODO Auto-generated method stub
		ZhuFrame.getZhuJpanel().cleargoodtext();
	}




}
